import {
  CommonModule,
  CurrencyPipe,
  DatePipe,
  JsonPipe,
  SlicePipe,
  TitleCasePipe,
  UpperCasePipe,
} from '@angular/common';
import { Component } from '@angular/core';
import { MyDirective01Directive } from '../my-directive-01.directive';
import { MyNgModelComponent } from '../my-ng-model/my-ng-model.component';
import { MyNgIfComponent } from '../my-ng-if/my-ng-if.component';
import { UserComponent } from '../user/user.component';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { Myc01Component } from '../myc01/myc01.component';
import { MyNgForComponent } from '../my-ng-for/my-ng-for.component';

@Component({
  selector: 'app-todo-list-emp-list',
  standalone: true,
  imports: [CommonModule, FormsModule, DatePipe, JsonPipe, SlicePipe],
  templateUrl: './todo-list-emp-list.component.html',
  styleUrl: './todo-list-emp-list.component.css',
})
export class TodoListEmpListComponent {
  constructor() {}
  empList = [
    {
      eid: '0001',
      name: 'zhangsan',
      salary: 3000,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '2023-10-23',
    },
    {
      eid: '0002',
      name: 'lisi',
      salary: 3000,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '2023-10-21',
    },
    {
      eid: '0003',
      name: 'wangwu',
      salary: 1235.12,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '2023-10-23',
    },
    {
      eid: '0004',
      name: 'jerry',
      salary: 5347.23,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '2023-10-23',
    },
    {
      eid: '0005',
      name: 'mike',
      salary: 1234.35,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '1990-10-23',
    },
    {
      eid: '0006',
      name: 'rose',
      salary: 3000,
      sex: 1,
      zzmm: 1,
      age: 10,
      birthday: '2013-6-23',
    },
    {
      eid: '00017',
      name: 'lucy',
      salary: 1232,
      sex: 0,
      zzmm: 0,
      age: 18,
      birthday: '2021-1-23',
    },
  ];

  doDelete(index: number) {
    this.empList.splice(index, 1);
  }
}
